home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 8 code / TValidText / MTest.p < prev    next >
Encoding:
Text File  |  1991-10-09  |  1.9 KB  |  83 lines  |  [TEXT/MPS ]

  1. {*******************************************************************************
  2. MTest.p
  3.     This minor extension to Apple's Nothing example throws up a dialog to
  4.     demonstrate the use of the TDateEditText, TTimeEditText, and TDateCluster
  5.     classes.
  6. *******************************************************************************}
  7.  
  8. PROGRAM Test;
  9.  
  10.   {$MC68020-}                        { The main program must be universal code }
  11.   {$MC68881-}
  12.  
  13.     USES
  14.         { • MacApp }
  15.         UMacApp,
  16.  
  17.         { • Building Blocks }
  18.         UPrinting,
  19.         UDialog,
  20.     
  21.         { • Implementation use }
  22.         Packages,
  23.         Script,
  24.     
  25.         { • Application Units }
  26.         UDateTimeUtilities,
  27.         UValidText,
  28.         UDateTimeText,
  29.         UTest,
  30.         UTEView;
  31.         
  32.     {---------------------------------------------------------------------------
  33.     Main Program
  34.         This is the standard main program; nothing fancy here.
  35.     ---------------------------------------------------------------------------}
  36.  
  37.     CONST
  38.         kSplash            = 3001;                 { Application's splash screen }
  39.  
  40.     VAR
  41.         gTestApplication:    TTestApplication;    { The application object }
  42.         theDialog:            DialogPtr;            { the splash screen }
  43.  
  44.     BEGIN
  45.     InitToolBox;
  46.     
  47.     { Pull app to front under MultiFinder™; required for splash screen }
  48.     PullApplicationToFront;
  49.     
  50.     IF ValidateConfiguration(gConfiguration)
  51.     THEN
  52.         BEGIN
  53.         { before initializing MacApp, throw up a splash screen }
  54.         theDialog := GetNewCenteredDialog(kSplash, NIL, WindowPtr(-1));
  55.         IF theDialog <> NIL
  56.         THEN
  57.             DrawDialog(theDialog);                { display splash dialog }
  58.         
  59.         { start MacApp initialization }
  60.         InitUMacApp(8);
  61.         InitUDialog;
  62.         InitUPrinting;
  63.         InitUTEView;
  64.         
  65.         { initialize application units }
  66.         InitUDateTimeUtilities;
  67.         InitUValidText;
  68.         InitUDateTimeText(shortDate);
  69.  
  70.         New(gTestApplication);
  71.         FailNIL(gTestApplication);
  72.         gTestApplication.ITestApplication(kFileType);
  73.         
  74.         IF theDialog <> NIL
  75.         THEN
  76.             DisposDialog(theDialog);                { remove splash dialog }
  77.  
  78.         gTestApplication.Run;
  79.         END
  80.     ELSE
  81.         StdAlert(phUnsupportedConfiguration);
  82.     END.  { main }
  83.